package com.zyk.scaffold.user.controller;


import com.zyk.scaffold.common.basic.BasicConstants;
import com.zyk.scaffold.core.domain.Result;
import com.zyk.scaffold.user.service.FunctionApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户-功能api关系表 前端控制器
 * </p>
 *
 * @author zhouyk
 * @since 2022-01-24
 */
@Api(tags = "功能api-API")
@RestController
@RequestMapping("/function-api")
public class FunctionApiController {
    @Autowired
    private FunctionApiService functionApiService;

    @ApiOperation("刷新功能api")
    @PostMapping("/refreshFunctionApi")
    public Result<Boolean> refreshFunctionApi(@RequestHeader(BasicConstants.HEADER_USER_ID) Long userId) {
        Boolean b = functionApiService.refreshFunctionApi(userId);
        return Result.ok(b);
    }

}
